/*     */ package com.lmpop.trade.ti_payment;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Ti_paymentInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_paymentInfo()
/*     */   {
/*  16 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  25 */     Ti_payment ti_payment = new Ti_payment();
/*  26 */     ti_payment.setCust_id(map.getString("cust_id"));
/*  27 */     ti_payment.setPay_id(map.getString("pay_id"));
/*  28 */     ti_payment.setPay_code(map.getString("pay_code"));
/*  29 */     ti_payment.setPay_name(map.getString("pay_name"));
/*  30 */     ti_payment.setPay_email(map.getString("pay_email"));
/*  31 */     ti_payment.setPay_desc(map.getString("pay_desc"));
/*  32 */     ti_payment.setPay_account(map.getString("pay_account"));
/*  33 */     ti_payment.setPasswd(map.getString("passwd"));
/*  34 */     ti_payment.setHand_fare(map.getInt("hand_fare"));
/*  35 */     ti_payment.setEnabled(map.getString("enabled"));
/*  36 */     ti_payment.setUser_id(map.getString("user_id"));
/*  37 */     ti_payment.setIn_date(map.getString("in_date"));
/*     */ 
/*  39 */     String result_code = "0";
/*     */     try {
/*  41 */       insert(dbmMgr, ti_payment);
/*     */     } catch (ApplicationException e) {
/*  43 */       e.printStackTrace();
/*  44 */       result_code = "1";
/*     */     }
/*  46 */     map.setString("result_code", result_code);
/*  47 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_payment ti_payment)
/*     */     throws ApplicationException
/*     */   {
/*  56 */     dbmMgr.update("insertTi_payment", ti_payment);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  66 */     String pkid_string = map.getString("pkid");
/*  67 */     String result_code = "0";
/*     */     try {
/*  69 */       if (!pkid_string.equals("")) {
/*  70 */         String[] pkStr = pkid_string.split("\\|");
/*  71 */         for (int i = 0; i < pkStr.length; i++) {
/*  72 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  76 */       e.printStackTrace();
/*  77 */       result_code = "1";
/*     */     }
/*  79 */     map.setString("result_code", result_code);
/*  80 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/*  89 */     dbmMgr.update("deleteTi_payment", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  98 */     Ti_payment ti_payment = new Ti_payment();
/*  99 */     ti_payment.setCust_id(map.getString("cust_id"));
/* 100 */     ti_payment.setPay_id(map.getString("pay_id"));
/* 101 */     ti_payment.setPay_code(map.getString("pay_code"));
/* 102 */     ti_payment.setPay_name(map.getString("pay_name"));
/* 103 */     ti_payment.setPay_desc(map.getString("pay_desc"));
/* 104 */     ti_payment.setPay_email(map.getString("pay_email"));
/* 105 */     ti_payment.setPay_account(map.getString("pay_account"));
/* 106 */     ti_payment.setPasswd(map.getString("passwd"));
/* 107 */     ti_payment.setHand_fare(map.getInt("hand_fare"));
/* 108 */     ti_payment.setEnabled(map.getString("enabled"));
/* 109 */     ti_payment.setUser_id(map.getString("user_id"));
/* 110 */     ti_payment.setIn_date(map.getString("in_date"));
/*     */ 
/* 112 */     String result_code = "0";
/*     */     try {
/* 114 */       update(dbmMgr, ti_payment);
/*     */     } catch (ApplicationException e) {
/* 116 */       e.printStackTrace();
/* 117 */       result_code = "1";
/*     */     }
/* 119 */     map.setString("result_code", result_code);
/* 120 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_payment ti_payment)
/*     */     throws ApplicationException
/*     */   {
/* 129 */     dbmMgr.update("updateTi_payment", ti_payment);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 139 */     Ti_payment ti_payment = (Ti_payment)obj;
/*     */ 
/* 141 */     if (start == 0)
/* 142 */       start = 0;
/*     */     else {
/* 144 */       start = (start - 1) * limit;
/*     */     }
/* 146 */     ti_payment.setStart(Integer.valueOf(start));
/* 147 */     ti_payment.setLimit(Integer.valueOf(limit));
/*     */ 
/* 156 */     return this.queryList.getList("getListByTi_paymentPage", ti_payment);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 167 */     Ti_payment ti_payment = (Ti_payment)obj;
/* 168 */     List list = this.queryList.getList("getCountByObjTi_payment", ti_payment);
/* 169 */     int count = 0;
/* 170 */     if ((list != null) && (list.size() > 0)) {
/* 171 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 172 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 173 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 176 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 197 */     return this.queryList.getList("getTi_paymentByPk", pk);
/*     */   }
/*     */ 
/*     */   public SysMap updateUse(DbmInterf dbmMgr, SysMap map) {
/* 201 */     Ti_payment ti_payment = new Ti_payment();
/*     */ 
/* 203 */     String pay_id = map.getString("pay_id");
/* 204 */     String enabled = map.getString("enabled");
/*     */ 
/* 206 */     String result_code = "0";
/*     */     try
/*     */     {
/* 209 */       if (!pay_id.equals("")) {
/* 210 */         String[] pay = pay_id.split("\\|");
/* 211 */         for (int i = 0; i < pay.length; i++)
/* 212 */           if (!pay[i].equals("")) {
/* 213 */             ti_payment.setPay_id(pay[i]);
/* 214 */             ti_payment.setEnabled(enabled);
/* 215 */             updateUse(dbmMgr, ti_payment);
/*     */           }
/*     */       }
/*     */     }
/*     */     catch (ApplicationException e)
/*     */     {
/* 221 */       e.printStackTrace();
/* 222 */       result_code = "1";
/*     */     }
/* 224 */     map.setString("result_code", result_code);
/* 225 */     return map;
/*     */   }
/*     */ 
/*     */   public void updateUse(DbmInterf dbmMgr, Ti_payment ti_payment) throws ApplicationException {
/* 229 */     dbmMgr.update("updateTi_paymentUse", ti_payment);
/*     */   }
/*     */ 
/*     */   public List getCustListByPage(Object obj, int start, int limit) {
/* 233 */     Ti_payment ti_payment = (Ti_payment)obj;
/*     */ 
/* 235 */     if (start == 0)
/* 236 */       start = 0;
/*     */     else {
/* 238 */       start = (start - 1) * limit;
/*     */     }
/* 240 */     ti_payment.setStart(Integer.valueOf(start));
/* 241 */     ti_payment.setLimit(Integer.valueOf(limit));
/*     */ 
/* 258 */     return this.queryList.getList("getCustListByTi_paymentPage", ti_payment);
/*     */   }
/*     */ 
/*     */   public int getCustCountByObj(Object obj)
/*     */   {
/* 269 */     Ti_payment ti_payment = (Ti_payment)obj;
/* 270 */     List list = this.queryList.getList("getCustCountByObjTi_payment", ti_payment);
/* 271 */     int count = 0;
/* 272 */     if ((list != null) && (list.size() > 0)) {
/* 273 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 274 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 275 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 278 */     return count;
/*     */   }
/*     */ 
/*     */   public List getEnabledPayment()
/*     */   {
/* 303 */     return this.queryList.getList("getEnableTi_payment", "");
/*     */   }
/*     */ 
/*     */   public String getPaySelectItem(String para)
/*     */   {
/* 313 */     String selectItems = "";
/*     */ 
/* 315 */     List list = getEnabledPayment();
/* 316 */     Hashtable objMap = new Hashtable();
/* 317 */     String sKey = "";
/* 318 */     String sValue = "";
/* 319 */     if ((list != null) && (list.size() > 0)) {
/* 320 */       for (int i = 0; i < list.size(); i++) {
/* 321 */         objMap = (Hashtable)list.get(i);
/* 322 */         if (objMap.get("pay_id") != null) {
/* 323 */           sKey = objMap.get("pay_id").toString();
/*     */         }
/* 325 */         if (objMap.get("pay_name") != null) {
/* 326 */           sValue = objMap.get("pay_name").toString();
/*     */         }
/* 328 */         if (para.equals(sKey))
/* 329 */           selectItems = selectItems + "<option selected value=" + sKey + ">" + sValue + "</option>";
/*     */         else {
/* 331 */           selectItems = selectItems + "<option value=" + sKey + ">" + sValue + "</option>";
/*     */         }
/*     */       }
/*     */     }
/* 335 */     return selectItems;
/*     */   }
/*     */ 
/*     */   public Map getAlipayInfo(String id)
/*     */   {
/* 340 */     Map map = null;
/* 341 */     List list = this.queryList.getList("getAlipay_Info", id);
/* 342 */     if ((list != null) && (list.size() > 0)) {
/* 343 */       map = (Hashtable)list.get(0);
/*     */     }
/* 345 */     return map;
/*     */   }
/*     */ 
/*     */   public Map getCustAlipayInfo(Map maps)
/*     */   {
/* 350 */     Map map = null;
/* 351 */     List list = this.queryList.getList("getCustAlipayInfo", maps);
/* 352 */     if ((list != null) && (list.size() > 0)) {
/* 353 */       map = (Hashtable)list.get(0);
/*     */     }
/* 355 */     return map;
/*     */   }
/*     */ 
/*     */   public List getCustPayment(String cust_id) {
/* 359 */     return this.queryList.getList("getPayInfobyCust", cust_id);
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_payment.Ti_paymentInfo
 * JD-Core Version:    0.6.0
 */